$.ajaxSetup({
    crossDomain: true,
    xhrFields: {
        withCredentials: true
    }
});

$.ajax({
    type: "GET",
    url: 'http://bianshi.hebinqunyan.com/islogin/admin',

}).done(function (data) {
    if (!data.success) {
        window.location.href = '../index.html'; // 调到获取接口
    }
});
$('.signOut').click(function () {
    $.ajaxSetup({
        crossDomain: true,
        xhrFields: {
            withCredentials: true
        }
    });

    $.ajax({
        type: "GET",
        url: 'http://bianshi.hebinqunyan.com/logout/admin',

    }).done(function (data) {
        if (data.success) {
            window.location.href = '../index.html';
        } else {
            alert(data.msg);
        }
    });
})
//时间处理
function formatdate(dateObject) {
    var d = new Date(dateObject);
    var day = d.getDate();
    var month = d.getMonth() + 1;
    var year = d.getFullYear();
    if (day < 10) {
        day = "0" + day;
    }
    if (month < 10) {
        month = "0" + month;
    }
    var date = year + "-" + month + "-" + day;

    return date;
}